/*----------------------------------------------------------------------------*\
| /gamemode/time.lua                   | time system                     | SHD |
\*----------------------------------------------------------------------------*/

time = {}
function time.Init()
	if (SERVER) then
		time.thetime = zday.MapConfig["info"]["starttime"]
		SetGlobalInt("thetime", time.thetime)
	else
		time.thetime = 0
	end
end
hook.Add( "Initialize", "Time Init", time.Init )

function time.UpdateTime()
	time.thetime = time.thetime + 1
	if (SERVER) then
		SetGlobalInt("thetime", time.thetime)
	end
end
timer.Create("UpdateTime", 1, 0, time.UpdateTime)
